clear,clc;
[a1_op,a2_op,a1,a2]=textread('comdata_op.txt','%f %f %f %f');
t=0:min(length(a1),length(a1_op))-1;
plot(t,a1(1:min(length(a1),length(a1_op))),'red',t,a1_op(1:min(length(a1),length(a1_op))),'blue');
grid on;

value_a1=0;
value_a1_op=0;
value_a2=0;
value_a2_op=0;
for i=1:min(length(a1),length(a1_op))
    value_a1=value_a1+abs(a1(i)-0);
    value_a1_op=value_a1_op+abs(a1_op(i)-0);
    value_a2=value_a2+abs(a2(i)-0);
    value_a2_op=value_a2_op+abs(a2_op(i)-0);
end